package com.maktoub.project.common;

/**
 * 错误码
 *
 * @author yupi
 */
public enum ErrorCode {

    SUCCESS(0, "ok"),
    PARAMS_ERROR(40000, "请求参数错误"),
    NOT_LOGIN_ERROR(40100, "未登录"),
    NO_AUTH_ERROR(40101, "您不具备该权限"),
    NOT_FOUND_ERROR(40400, "请求数据不存在"),
    FORBIDDEN_ERROR(40300, "禁止访问"),
    SYSTEM_ERROR(50000, "系统内部异常"),
    INTERFACE_ERROR(50000, "接口异常,请稍后重试"),
    INTERFACE_CLOSE(50000, "接口已关闭"),
    FILE_UPLOAD_ERROE(50001, "头像上传失败"),
    OLD_PASSWORD_ERROE(400, "旧密码输入错误"),
    TWO_PASSWORD_ERROE(400, "新旧密码不一致"),
    OPERATION_ERROR(50001, "操作失败");


    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息
     */
    private final String message;

    ErrorCode(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

}
